Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadRotator=function(a){Telerik.Web.UI.RadRotator.initializeBase(this,[a]);
this._enabled=true;
this._skin="Default";
this._postBackReference=null;
this._items=null;
this._webServiceSettings=new Telerik.Web.UI.WebServiceSettings({});
this._webServiceLoader=null;
this._containerElement=null;
this._clickDelegate=null;
this._mouseOutDelegate=null;
this._mouseOverDelegate=null;
this._itemShownDelegate=null;
this._rotatorDisposed=false;
this._useRandomSlide=false;
var b=Telerik.Web.UI.RotatorScrollDirection;
this._scrollDirection=b.Left+b.Right;
this._slideShowAnimationSettings={};
this._rotatorType=Telerik.Web.UI.RotatorType.AutomaticAdvance;
this._scrollDuration=500;
this._frameDuration=2000;
this._initialItemIndex=0;
this._canPause=true;
this._pauseOnMouseOver=true;
this._wrapFrames=true;
this._controlButtons={};
this._relativeWrapper=null;
this._clipElement=null;
this._itemsElement=null;
this._animationDirection=b.Left;
this._rightButton=null;
this._leftButton=null;
this._downButton=null;
this._upButton=null;
this._isMouseOverClipElement=false;
};
Telerik.Web.UI.RadRotator.prototype={initialize:function(){Telerik.Web.UI.RadRotator.callBaseMethod(this,"initialize");
this._rotatorDisposed=false;
this._wrapFramesFinished=false;
this._setChildElements();
this._createUI();
this._createChildItems();
this._attachEvents(true);
this._initialItemSet=false;
this._loadInitialFrame();
this._enableDisableButtons();
this._fixVisibilityProblems(true);
if($telerik.isSafari){$addHandler(this.get_containerElement(),"mousewheel",this._mouseWheelHandler);
}this.raiseEvent("load",Sys.EventArgs.Empty);
if(this.isAutomaticAdvance()){var a=this.get_frameDuration();
if(a>0){window.setTimeout(Function.createDelegate(this,this.startAutoPlay),a);
}else{this.startAutoPlay();
}}},dispose:function(){this._rotatorDisposed=true;
this._fixVisibilityProblems(false);
this._attachEvents(false);
this._containerElement=null;
if(this._animation){this._animation.dispose();
this._animation=null;
}if(this._rightButton){$clearHandlers(this._rightButton);
}if(this._leftButton){$clearHandlers(this._leftButton);
}if(this._downButton){$clearHandlers(this._downButton);
}if(this._upButton){$clearHandlers(this._upButton);
}if($telerik.isSafari){$removeHandler(this.get_containerElement(),"mousewheel",this._mouseWheelHandler);
}if(this._itemsElement){$clearHandlers(this._itemsElement);
}Telerik.Web.UI.RadRotator.callBaseMethod(this,"dispose");
},_createChildItems:function(){var d=$telerik.getChildrenByTagName(this.get_containerElement(),"li");
for(var b=0;
b<d.length;
b++){var a=$create(Telerik.Web.UI.RadRotatorItem,this.get_items()[b],null,null,d[b]);
var c=a.get_index();
d[b]._item=a;
this.get_items()[b]=a;
}},_mouseWheelHandler:function(a){a.preventDefault();
},_getNextItemToShow:function(){var c=this.getItemHtmlElements();
var b=this.isScrollingForward();
if(this._nextItemIndex==null){var d=b?0:c.length-1;
this._nextItemIndex=d;
}if(this._nextItemIndex<0){return null;
}var a=c[this._nextItemIndex];
if(b){this._nextItemIndex++;
}else{this._nextItemIndex--;
}if(this._nextItemIndex>c.length-1||this._nextItemIndex<0){this._nextItemIndex=null;
}return a;
},get_firstItem:function(){var b=this._firstItem;
if(!b){var a=this.getItemHtmlElements();
b=this.isScrollingForward()?a[0]:a[a.length-1];
}return b;
},get_currentItem:function(){var d=this.getItemHtmlElements();
var b=parseInt(d[0].parentNode.style.left),e="left";
if(isNaN(b)||b==0){b=parseInt(d[0].parentNode.style.top);
e="top";
}var g=0,a=d.length;
while(b<0&&g<a){var f=$telerik.getOuterSize(d[g]);
b=b+(e=="top"?f.height:f.width);
g++;
}var c=g<a?d[g].control:null;
return c;
},_needsShift:function(a){if(null==a){a=this.get_animationDirection();
}var e=this._itemsElement;
var d=this._clipElement;
var b=parseInt(e.style.left);
var h=parseInt(e.style.top);
var g=$telerik.getOuterSize(e);
var i=$telerik.getContentSize(d);
var k=this.get_firstItem();
if(!k){return false;
}var f=$telerik.getOuterSize(k);
var c=false;
var j=Telerik.Web.UI.RotatorScrollDirection;
switch(a){case j.Left:c=b+g.width<i.width+f.width;
break;
case j.Up:c=h+g.height<i.height+f.height;
break;
case j.Right:c=b*-1<f.width;
break;
case j.Down:c=h*-1<i.height;
break;
}return c;
},_getMoveAnimation:function(){if(!this._animation){var b=this._itemsElement;
var c=this.get_scrollDuration();
var a=25;
this._animation=new Telerik.Web.UI.Animations.jMove(this,b,c,true,false);
this._animation.initialize();
}return this._animation;
},scrollViewport:function(){if(!this.get_enabled()){return;
}var a=this._itemsElement;
if(!this._animation){var c=this._getMoveAnimation();
var b=Function.createDelegate(this,function(){var j=this._hasViewportWidth();
if(!j&&this.get_wrapFrames()){var f=this.getItemHtmlElements().length;
for(var h=0;
h<f;
h++){this._shiftItemInList();
j=this._hasViewportWidth();
if(j){break;
}}}var e=this._getViewPortPixelsToScroll();
var d=this.isScrollingForward();
if(this.get_vertical()){var g=parseInt(a.style.top)+(d?-e:e);
c.set_vertical(g);
}else{var g=parseInt(a.style.left)+(d?-e:e);
c.set_horizontal(g);
}});
c.add_started(Function.createDelegate(this,function(d,e){this.stopViewportAnimation();
var h=!this._hasViewportWidth();
if(h&&!this.get_wrapFrames()){var f=this.get_animationDirection();
if(this._wrapFramesFinished==f){e.set_cancel(true);
return false;
}else{this._wrapFramesFinished=f;
}}else{this._wrapFramesFinished=0;
}var g=this.get_currentItem();
var i=new Telerik.Web.UI.RadRotatorCancelEventArgs(g);
this.raiseEvent("itemShowing",i);
if(i.get_cancel&&i.get_cancel()){e.set_cancel(true);
return false;
}if(this.isSlideShow()){a.style.visibility="hidden";
}b();
}));
c.add_ended(Function.createDelegate(this,function(){this._enableDisableButtons();
if(this.isSlideShow()){a.style.visibility="visible";
this.runSlideShowAnimation();
}else{var d=this.get_currentItem();
this.raiseEvent("itemShown",new Telerik.Web.UI.RadRotatorEventArgs(d));
}}));
}this._animation.play();
},scrollItem:function(){if(!this.get_enabled()){return;
}var d=this._clipElement;
var a=this._itemsElement;
if(!this._animation){var c=this._animation=this._getMoveAnimation();
if(this.isAutomaticAdvance()||this._isRotatorTypeEnabled(Telerik.Web.UI.RotatorType.ButtonsOver)){c.set_isCyclic(true);
}var b=Function.createDelegate(this,function(){var g=this._getNextItemToShow();
if(!g){return;
}this._firstItem=g;
var f=$telerik.getOuterSize(g);
if(this.isScrollingForward()){f.width*=-1;
f.height*=-1;
}if(this.get_vertical()){var e=parseInt(a.style.top)+f.height;
c.set_vertical(e);
}else{var e=parseInt(a.style.left)+f.width;
c.set_horizontal(e);
}});
c.add_started(Function.createDelegate(this,function(e,f){var i=this._needsShift(g);
if(i&&!this.get_wrapFrames()){var g=this.get_animationDirection();
if(this._wrapFramesFinished==g){f.set_cancel(true);
return false;
}else{this._wrapFramesFinished=g;
}}else{this._wrapFramesFinished=0;
}var h=this.get_currentItem();
var j=new Telerik.Web.UI.RadRotatorCancelEventArgs(h);
this.raiseEvent("itemShowing",j);
if(j.get_cancel&&j.get_cancel()){f.set_cancel(true);
return false;
}if(i&&this.get_wrapFrames()){this._shiftItemInList();
}if(this._stopAnimationButtonOver){return;
}b();
}));
c.add_ended(Function.createDelegate(this,function(){this._enableDisableButtons();
var e=this.get_currentItem();
if(e!=null){this.raiseEvent("itemShown",new Telerik.Web.UI.RadRotatorEventArgs(e));
}if(this._stopAnimationButtonOver){return;
}if(this.isAutomaticAdvance()||this._isRotatorTypeEnabled(Telerik.Web.UI.RotatorType.ButtonsOver)){if(this.get_frameDuration()>0){this._setAnimationTimeout(this.get_frameDuration());
}else{this._animation.play();
}}}));
}this._animation.stop();
this._animation.play();
},_checkItemsSize:function(){var a=$telerik.getOuterSize(this._itemsElement);
var c=this.get_vertical();
var d=(c)?a.height:a.width;
var b=(c)?this.get_height():this.get_width();
return parseInt(d)>parseInt(b);
},_shiftItemInList:function(){var b=this._itemsElement;
var f=this.getItemHtmlElements();
var c=this.get_vertical();
var d=this.isScrollingForward();
var a=parseInt(b.style.left);
var h=parseInt(b.style.top);
var e=d?f[0]:f[f.length-1];
var g=$telerik.getOuterSize(e);
e.parentNode.removeChild(e);
if(!d){b.insertBefore(e,b.firstChild);
}if(c){b.style.top=(h+(d?g.height:-g.height))+"px";
}else{b.style.left=(a+(d?g.width:-g.width))+"px";
}if(d){b.appendChild(e);
}this._nextItemIndex=d?f.length-1:0;
return e;
},_loadInitialFrame:function(){var a=this.get_initialItemIndex();
var g=this.get_defaultAnimationDirection();
var k=Telerik.Web.UI.RotatorScrollDirection;
var e=this.isVertical();
var b=this._itemsElement;
var f=$telerik.getOuterSize(b);
var h=$telerik.getContentSize(this._clipElement);
var c=0;
var d=0;
if(a>=0){if(e){d=(g==k.Up)?0:-f.height+h.height;
}else{c=(g==k.Left)?0:-f.width+h.width;
}}else{if(a==-1){if(e){d=(g==k.Down)?-f.height:h.height;
}else{c=(g==k.Right)?-f.width:h.width;
}}}b.style.left=c+"px";
b.style.top=d+"px";
if(a>0&&!this._initialItemSet){for(var j=0;
j<a;
j++){this._shiftItemInList();
}b.style.left=c+"px";
b.style.top=d+"px";
}if(!this._initialItemSet&&a>=0){this.raiseEvent("itemShown",new Telerik.Web.UI.RadRotatorEventArgs(this.get_items()[a]));
}this._initialItemSet=true;
},pause:function(){if(this._isPaused){return;
}this._isPaused=true;
if(this._animation&&this._animation.get_isActive()){this._animation.pause();
}},resume:function(){if(this._timeoutPassed||!this._isPaused){if(this._animation){this._animation.play(this._timeoutPassed);
}}else{if(this._isPaused){if(this._animation&&this._animation.get_isActive()){this._animation.play();
}}}this._isPaused=false;
},stop:function(){this._clearAnimationTimeout();
this._canPause=false;
this.pause();
},start:function(){this._canPause=true;
this._isPaused=false;
this.resume();
},isViewportScrollMode:function(){var a=Telerik.Web.UI.RotatorType;
if(this._isRotatorTypeEnabled(a.AutomaticAdvance)||this._isRotatorTypeEnabled(a.ButtonsOver)||this._isRotatorTypeEnabled(a.FromCode)){return false;
}return true;
},_getButtonScrollDirection:function(b){var c=Telerik.Web.UI.RotatorScrollDirection;
var a=c.Left;
switch(b){case this._rightButton:a=c.Left;
break;
case this._leftButton:a=c.Right;
break;
case this._downButton:a=c.Up;
break;
case this._upButton:a=c.Down;
break;
}return a;
},_buttonClicked:function(d){if(!this.get_enabled()){$telerik.cancelRawEvent(d);
return false;
}var c=d.target;
if(this._isButtonDisabled(c)||this.get_items().length==0){return;
}var a=new Telerik.Web.UI.RadRotatorButtonEventArgs(c);
this.raiseEvent("buttonClick",a);
if(a.get_cancel()){return;
}var b=this._getButtonScrollDirection(c);
this.set_animationDirection(b);
this.scrollViewport();
return $telerik.cancelRawEvent(d);
},_buttonOver:function(d){if(!this.get_enabled()){$telerik.cancelRawEvent(d);
return false;
}var c=d.target;
if(this._isButtonDisabled(c)||this.get_items().length==0){return;
}var a=new Telerik.Web.UI.RadRotatorButtonEventArgs(c);
this.raiseEvent("buttonOver",a);
if(a.get_cancel()){return;
}var b=this._getButtonScrollDirection(c);
this.set_animationDirection(b);
this._stopAnimationButtonOver=false;
this.scrollItem();
return $telerik.cancelRawEvent(d);
},_buttonOut:function(d){if(!this.get_enabled()){$telerik.cancelRawEvent(d);
return false;
}var c=d.target;
if(this._isButtonDisabled(c)){return;
}var a=new Telerik.Web.UI.RadRotatorButtonEventArgs(c);
this.raiseEvent("buttonOut",a);
if(a.get_cancel()){return;
}var b=this._getButtonScrollDirection(c);
this.set_animationDirection(b);
this._stopAnimationButtonOver=true;
return $telerik.cancelRawEvent(d);
},_initializeButtonsRotatorType:function(){var r=this.get_controlButtons();
this._rightButton=$telerik.getElementByClassName(this._rootElement,this._rotatorRightClass);
this._leftButton=$telerik.getElementByClassName(this._rootElement,this._rotatorLeftClass);
this._downButton=$telerik.getElementByClassName(this._rootElement,this._rotatorDownClass);
this._upButton=$telerik.getElementByClassName(this._rootElement,this._rotatorUpClass);
var g=Telerik.Web.UI.RotatorScrollDirection;
var f=[g.Right,g.Left,g.Down,g.Up];
var k=[this._leftButton,this._rightButton,this._upButton,this._downButton];
var q=[r.LeftButtonID?$get(r.LeftButtonID):null,r.RightButtonID?$get(r.RightButtonID):null,r.UpButtonID?$get(r.UpButtonID):null,r.DownButtonID?$get(r.DownButtonID):null];
var l=[this._rotatorLeftClass,this._rotatorRightClass,this._rotatorUpClass,this._rotatorDownClass];
var b=["marginLeft","marginRight","marginTop","marginBottom"];
var m=["paddingLeft","paddingRight","paddingTop","paddingBottom"];
var a=["width","width","height","height"];
var o=this._relativeWrapper;
var j=this.get_element();
for(var h=0;
h<k.length;
h++){var c=k[h];
var p=(null!=q[h])?q[h]:c;
this._createButton(c,l[h]);
if(this._isScrollDirectionEnabled(f[h])&&null==q[h]){c.style.display="block";
var n=a[h];
var d=parseInt($telerik.getCurrentStyle(c,n));
o.style[n]=(parseInt(o.style[n])-d)+"px";
j.style[n]=(parseInt(j.style[n])-d)+"px";
j.style[m[h]]=d+"px";
}if(this._isRotatorTypeEnabled(Telerik.Web.UI.RotatorType.Buttons)||this._isRotatorTypeEnabled(Telerik.Web.UI.RotatorType.SlideShowButtons)){$clearHandlers(p);
$addHandlers(p,{click:this._buttonClicked},this);
}else{$clearHandlers(p);
$addHandlers(p,{mouseover:this._buttonOver,mouseout:this._buttonOut},this);
}}this._rightButton=q[1]||this._rightButton;
this._leftButton=q[0]||this._leftButton;
this._downButton=q[3]||this._downButton;
this._upButton=q[2]||this._upButton;
var e=false;
for(var h=0;
h<q.length;
h++){if(q[h]){e=true;
}break;
}return e;
},runSlideShowAnimation:function(){var b=this._itemsElement;
var c=this.get_slideShowAnimationSettings().duration||500;
var a=this.get_slideShowAnimationSettings().type||Telerik.Web.UI.RotatorAnimationType.None;
var d=Function.createDelegate(this,function(){this._canPause=true;
if(a!=Telerik.Web.UI.RotatorAnimationType.None){$telerik.$(this._itemsElement).css("opacity","1");
}var e=this.get_currentItem();
this.raiseEvent("itemShown",new Telerik.Web.UI.RadRotatorEventArgs(e));
if(this.get_frameDuration()>0&&this.isAutomaticAdvance()){this._setAnimationTimeout(this.get_frameDuration());
}});
switch(a){case Telerik.Web.UI.RotatorAnimationType.Fade:this._canPause=false;
$telerik.$(b).css("opacity","0").fadeTo(c,1,d);
break;
case Telerik.Web.UI.RotatorAnimationType.Pulse:this._canPause=false;
$telerik.$(b).fadeTo(c,0).fadeTo(c,1,d);
break;
default:d();
break;
}},_hasViewportWidth:function(a){if(null==a){a=this.get_animationDirection();
}var e=this._itemsElement;
var d=this._clipElement;
var b=parseInt(e.style.left);
var g=parseInt(e.style.top);
var f=$telerik.getOuterSize(e);
var h=$telerik.getContentSize(d);
var c=false;
var i=Telerik.Web.UI.RotatorScrollDirection;
switch(a){case i.Left:c=f.width+b<h.width*2;
break;
case i.Up:c=f.height+g<h.height*2;
break;
case i.Right:c=(b*-1<h.width);
break;
case i.Down:c=(g*-1<h.height);
break;
}return !c;
},stopViewportAnimation:function(){var c=this._animation;
if(!c){return;
}if(c.get_isPlaying()){c.stop();
var b=this.get_vertical();
var a=b?c.get_vertical():c.get_horizontal();
if(null!=a){this._itemsElement.style[b?"top":"left"]=a+"px";
}}},_getViewPortPixelsToScroll:function(){var c=this.get_vertical();
var a=$telerik.getContentSize(this._clipElement);
var b=c?a.height:a.width;
return b;
},showNext:function(a){this.set_animationDirection(a);
if(!this._checkItemsSize()){return;
}if(this.isViewportScrollMode()){this.scrollViewport();
}else{this.scrollItem();
}},getItemHtmlElements:function(){var a=this._itemsElement;
if(!this._hasCleanedList){var b=a.childNodes;
for(var c=0;
c<b.length;
c++){var d=b[c];
if(d&&d.tagName!="LI"){a.removeChild(d);
c--;
}}this._hasCleanedList=true;
}return a.childNodes;
},_setAnimationTimeout:function(a){this._clearAnimationTimeout();
this._currentAnimationTimeout=window.setTimeout(Function.createDelegate(this,function(){if(!this._isPaused){this.resume();
}this._timeoutPassed=true;
}),a);
},_clearAnimationTimeout:function(){if(this._currentAnimationTimeout){window.clearTimeout(this._currentAnimationTimeout);
}this._currentAnimationTimeout=0;
this._timeoutPassed=false;
},isAutomaticAdvance:function(){var a=Telerik.Web.UI.RotatorType;
if(this._isRotatorTypeEnabled(a.AutomaticAdvance)||this._isRotatorTypeEnabled(a.SlideShow)){return true;
}return false;
},isSlideShow:function(){var a=Telerik.Web.UI.RotatorType;
if(this._isRotatorTypeEnabled(a.SlideShow)||this._isRotatorTypeEnabled(a.SlideShowButtons)){return true;
}return false;
},isScrollingForward:function(){return this.isScrollingLeft()||this.isScrollingUp();
},isScrollingLeft:function(){return this._isAnimationDirectionOn(Telerik.Web.UI.RotatorScrollDirection.Left);
},isScrollingUp:function(){return this._isAnimationDirectionOn(Telerik.Web.UI.RotatorScrollDirection.Up);
},_isAnimationDirectionOn:function(a){return a==this.get_animationDirection()?true:false;
},_enableDisableButtons:function(){if(this._rotatorType==Telerik.Web.UI.RotatorType.AutomaticAdvance){return;
}var a=this.get_wrapFrames();
var b=Telerik.Web.UI.RotatorScrollDirection;
this._enableButton(this._rightButton,a||this._canSlideMore(b.Left));
this._enableButton(this._leftButton,a||this._canSlideMore(b.Right));
this._enableButton(this._downButton,a||this._canSlideMore(b.Up));
this._enableButton(this._upButton,a||this._canSlideMore(b.Down));
},_enableButton:function(b,a){if(!b){return;
}if(a){Sys.UI.DomElement.removeCssClass(b,this._rotatorButtonDisabledClass);
b.removeAttribute("disabled");
}else{Sys.UI.DomElement.addCssClass(b,this._rotatorButtonDisabledClass);
b.setAttribute("disabled","disabled");
}},_canSlideMore:function(e){if(null==e){e=this.get_animationDirection();
}var c=false;
var d=this._itemsElement;
var a=this._clipElement;
var i=Telerik.Web.UI.RotatorScrollDirection;
var b=parseInt(d.style.left);
var f=parseInt(d.style.top);
var g=$telerik.getBounds(d);
var h=$telerik.getBounds(a);
if(e==i.Left){c=(g.width+b)>h.width;
}else{if(e==i.Up){c=(g.height+f)>h.height;
}else{if(e==i.Right){c=(b<0);
}else{if(e==i.Down){c=(f<0);
}}}}return c;
},_getCalculatedAnimationDirection:function(){var a=this.get_animationDirection();
var c=Telerik.Web.UI.RotatorScrollDirection;
var b=23;
switch(a){case c.Left:b=21;
break;
case c.Down:b=32;
break;
case c.Up:b=12;
break;
default:b=23;
}return b;
},startAutoPlay:function(){if(this._rotatorDisposed){return;
}this._loadInitialFrame();
this.showNext(this.get_defaultAnimationDirection());
},get_defaultAnimationDirection:function(){var b=Telerik.Web.UI.RotatorScrollDirection;
var a=0;
if(this._isScrollDirectionEnabled(b.Left)){a=b.Left;
}else{if(this._isScrollDirectionEnabled(b.Up)){a=b.Up;
}else{if(this._isScrollDirectionEnabled(b.Right)){a=b.Right;
}else{if(this._isScrollDirectionEnabled(b.Down)){a=b.Down;
}}}}if(!a){a=b.Left;
}return a;
},get_containerElement:function(){return this._itemsElement;
},_setChildElements:function(){this._rotatorListClass="rrItemsList";
this._rotatorVerticalClass="rrVerticalList";
this._rotatorRelativeWrapperClass="rrRelativeWrapper";
this._rotatorClipRegionClass="rrClipRegion";
this._rotatorRightClass="rrButtonRight";
this._rotatorLeftClass="rrButtonLeft";
this._rotatorDownClass="rrButtonDown";
this._rotatorUpClass="rrButtonUp";
this._rotatorButtonDisabledClass="rrButtonDisabled";
this._rootElement=this.get_element();
this._relativeWrapper=$telerik.getElementByClassName(this._rootElement,this._rotatorRelativeWrapperClass);
this._clipElement=$telerik.getElementByClassName(this._rootElement,this._rotatorClipRegionClass);
this._itemsElement=$telerik.getElementByClassName(this._rootElement,this._rotatorListClass);
},_createUI:function(){if(!this.isVisible()){return;
}this._fixRootElementSize();
var a=this.get_element();
var d=this._relativeWrapper;
d.style.height=a.offsetHeight+"px";
d.style.width=a.offsetWidth+"px";
var c=true;
if(this._isRotatorTypeEnabled(Telerik.Web.UI.RotatorType.Buttons)||this._isRotatorTypeEnabled(Telerik.Web.UI.RotatorType.ButtonsOver)||this._isRotatorTypeEnabled(Telerik.Web.UI.RotatorType.SlideShowButtons)){c=this._initializeButtonsRotatorType();
}if(c){Sys.UI.DomElement.addCssClass(a,"rrNoBorder");
}if(this.get_vertical()){this.set_vertical(true);
}d.style.overflow="auto";
var b=this._clipElement;
b.style.overflow="auto";
b.style.width="10000px";
b.style.height="10000px";
this._itemsElement.style.width=this.get_vertical()?d.style.width:this._itemsElement.offsetWidth+"px";
this._itemsElement.style.height=this._itemsElement.offsetHeight+"px";
d.style.overflow="";
b.style.width=d.style.width;
b.style.height=d.style.height;
b.style.overflow="hidden";
b.style.position="relative";
this._itemsElement.style.position="relative";
a.style.visibility="visible";
},_fixRootElementSize:function(){var a=this.get_element();
var c=Telerik.Web.UI.RotatorScrollDirection;
var b=parseInt(a.style.paddingLeft);
if(b&&!isNaN(b)&&this._isScrollDirectionEnabled(c.Left)){a.style.width=(parseInt(a.style.width)+b)+"px";
a.style.paddingLeft="";
}b=parseInt(a.style.paddingRight);
if(b&&!isNaN(b)&&this._isScrollDirectionEnabled(c.Right)){a.style.width=(parseInt(a.style.width)+b)+"px";
a.style.paddingRight="";
}b=parseInt(a.style.paddingTop);
if(b&&!isNaN(b)&&this._isScrollDirectionEnabled(c.Up)){a.style.height=(parseInt(a.style.height)+b)+"px";
a.style.paddingTop="";
}b=parseInt(a.style.paddingBottom);
if(b&&!isNaN(b)&&this._isScrollDirectionEnabled(c.Down)){a.style.height=(parseInt(a.style.height)+b)+"px";
a.style.paddingBottom="";
}},_createButton:function(c,b){var a=c;
if(!a){a=document.createElement("div");
}if(!a.className){a.className=this._rotatorDownClass;
}return a;
},_isButtonDisabled:function(a){if(!a){return true;
}return Sys.UI.DomElement.containsCssClass(a,this._rotatorButtonDisabledClass);
},_isScrollDirectionEnabled:function(a){return a&this._scrollDirection?true:false;
},_isRotatorTypeEnabled:function(a){return a==this._rotatorType?true:false;
},get_rotatorType:function(){return this._rotatorType;
},set_rotatorType:function(a){this._rotatorType=a;
},get_wrapFrames:function(){return this._wrapFrames;
},set_wrapFrames:function(a){this._wrapFrames=a;
},get_scrollDuration:function(){if(this.isSlideShow()){return 1;
}else{return this._scrollDuration;
}},set_scrollDuration:function(a){this._scrollDuration=a;
},set_vertical:function(a){var b=this._itemsElement;
if(b){Sys.UI.DomElement.addCssClass(b,this._rotatorVerticalClass);
}},get_vertical:function(){var a=Telerik.Web.UI.RotatorScrollDirection;
return(this._isScrollDirectionEnabled(a.Down)||this._isScrollDirectionEnabled(a.Up));
},isVertical:function(){if(this._itemsElement){return Sys.UI.DomElement.containsCssClass(this._itemsElement,this._rotatorVerticalClass);
}return false;
},get_height:function(){return this.get_element().style.height;
},set_height:function(a){this.get_element().style.height=a;
if(this.isVisible()){this.repaint();
}},get_width:function(){return this.get_element().style.width;
},set_width:function(a){this.get_element().style.width=a;
if(this.isVisible()){this.repaint();
}},get_scrollDirection:function(){return this._scrollDirection;
},set_scrollDirection:function(a){this._scrollDirection=a;
},get_frameDuration:function(){return this._frameDuration;
},set_frameDuration:function(a){this._frameDuration=a;
},get_controlButtons:function(){return this._controlButtons;
},set_controlButtons:function(a){this._controlButtons=a;
},get_initialItemIndex:function(){return this._initialItemIndex;
},set_initialItemIndex:function(a){this._initialItemIndex=a;
},get_slideShowAnimationSettings:function(){return this._slideShowAnimationSettings;
},set_slideShowAnimationSettings:function(a){this._slideShowAnimationSettings=a;
},set_animationDirection:function(a){this._animationDirection=a?a:Telerik.Web.UI.RotatorScrollDirection.Left;
},get_animationDirection:function(){return this._animationDirection;
},_attachEvents:function(a){var b=this.get_containerElement();
if(null==b){return;
}if(a!=false){this._clickDelegate=Function.createDelegate(this,this._mouseClickHandler);
this._mouseOutDelegate=Function.createDelegate(this,this._mouseOutHandler);
this._mouseOverDelegate=Function.createDelegate(this,this._mouseOverHandler);
this._itemShownDelegate=Function.createDelegate(this,this._itemShownHandler);
$addHandler(b,"mouseover",this._mouseOverDelegate);
$addHandler(b,"mouseout",this._mouseOutDelegate);
$addHandler(b,"click",this._clickDelegate);
this.add_itemShown(this._itemShownDelegate);
}else{$removeHandler(b,"mouseover",this._mouseOverDelegate);
$removeHandler(b,"mouseout",this._mouseOutDelegate);
$removeHandler(b,"click",this._clickDelegate);
this._clickDelegate=null;
this._mouseOutDelegate=null;
this._mouseOverDelegate=null;
this.remove_itemShown(this._itemShownDelegate);
}},_itemShownHandler:function(b){if(typeof(Telerik.Web.UI.RadTicker)=="undefined"){return;
}var d=this.get_items();
for(var e=0,a=d.length;
e<a;
e++){var c=d[e];
if(this._isItemVisible(c)){this._fireTickersForItem(c);
}else{this._resetTickersForItem(c);
}}},_mouseOverHandler:function(a){if(this._isMouseOverClipElement){return;
}this._isMouseOverClipElement=true;
if(this.isAutomaticAdvance()&&this._canPause&&this.get_pauseOnMouseOver()){this.pause();
}var b=this._getItemFromEvent(a.target);
if(null!=b){this.raiseEvent("mouseOver",new Telerik.Web.UI.RadRotatorEventArgs(b));
}},_mouseOutHandler:function(a){if($telerik.isMouseOverElementEx(this._clipElement,a.rawEvent)){return;
}this._isMouseOverClipElement=false;
if(this.isAutomaticAdvance()&&this._canPause&&this.get_pauseOnMouseOver()){this.resume();
}var b=this._getItemFromEvent(a.target);
if(null!=b){this.raiseEvent("mouseOut",new Telerik.Web.UI.RadRotatorEventArgs(b));
}return false;
},_mouseClickHandler:function(a){if(!this.get_enabled()){$telerik.cancelRawEvent(a.rawEvent);
return false;
}var b=this._getItemFromEvent(a.target);
if(null!=b){var c=new Telerik.Web.UI.RadRotatorCancelEventArgs(b);
this.raiseEvent("itemClicking",c);
if(c.get_cancel&&c.get_cancel()){$telerik.cancelRawEvent(a.rawEvent);
return false;
}window.setTimeout(Function.createDelegate(this,function(){this.raiseEvent("itemClicked",new Telerik.Web.UI.RadRotatorEventArgs(b));
this._postback(b.get_index());
}),0);
}},_postback:function(b){if(!this._postBackReference){return;
}var a=this._postBackReference.replace("arguments",b);
eval(a);
},_isItemVisible:function(f){var e=$telerik.getContentSize(this._clipElement);
var a=$telerik.getLocation(this._clipElement);
e.x=a.x;
e.y=a.y;
var b=$telerik.getOuterSize(f.get_element());
var a=$telerik.getLocation(f.get_element());
b.x=a.x;
b.y=a.y;
var c=($telerik.containsPoint(e,b.x,b.y)&&$telerik.containsPoint(e,b.x+b.width,b.y+b.height));
var d=($telerik.containsPoint(b,e.x,e.y)&&$telerik.containsPoint(b,e.x+e.width,e.y+e.height));
return c||d;
},_fireTickersForItem:function(e){var c=e.get_tickers();
for(var d=0,a=c.length;
d<a;
d++){if(c[d]){var b=$find(c[d]);
if(b){b.startTicker();
}}}},_resetTickersForItem:function(e){var c=e.get_tickers();
for(var d=0,a=c.length;
d<a;
d++){if(c[d]){var b=$find(c[d]);
if(b){b.resetTicker();
}}}},_getItemFromEvent:function(c){var a=this.get_containerElement();
var b=null;
while(null!=c&&c!=a&&c!=document){if(c.tagName.toLowerCase()=="li"&&null!=c._item&&Object.getTypeName(c._item)=="Telerik.Web.UI.RadRotatorItem"){b=c._item;
}c=c.parentNode;
}return b;
},_initializeWebServiceLoader:function(){this._webServiceLoader=new Telerik.Web.UI.WebServiceLoader(this.get_webServiceSettings());
this._webServiceLoader.add_loadingStarted(Function.createDelegate(this,this._onItemLoadingStarted));
this._webServiceLoader.add_loadingSuccess(Function.createDelegate(this,this._onItemLoadingSuccess));
this._webServiceLoader.add_loadingError(Function.createDelegate(this,this._onItemLoadingError));
},_loadChildrenFromWebService:function(c,b){if(!this._webServiceLoader){this._initializeWebServiceLoader();
}var a={itemIndex:c,itemCount:b};
this._webServiceLoader.loadData(a,a);
},_onItemLoadingStarted:function(a,b){},_onItemLoadingSuccess:function(a,d){var b=d.get_data();
if(b&&b.length>0){for(var c=0;
c<b.length;
c++){this.createRotatorItem(b[c]);
}}},_onItemLoadingError:function(a,c){var b=c.get_message();
alert(b);
},createRotatorItem:function(a){var b=this.get_containerElement();
var d=b.ownerDocument.createElement("li");
b.appendChild(d);
d.innerHTML=a.Html;
var e={cssClass:a.CssClass,visible:a.Visible};
var c=$create(Telerik.Web.UI.RadRotatorItem,e,null,null,d);
d._item=c;
Array.add(this.get_items(),c);
},_getInvisibleParent:function(){var a=this.get_element();
while(a&&a!=document){if("none"==$telerik.getCurrentStyle(a,"display","")){return a;
}a=a.parentNode;
}return null;
},isVisible:function(){return(this._getInvisibleParent()==null);
},_fixVisibilityProblems:function(a){if(a){var b=this._getInvisibleParent();
if(b){this._onParentVisibilityChangeDelegate=Function.createDelegate(this,this._onParentVisibilityChange);
this._invisibleParent=b;
if($telerik.isIE){$addHandler(this._invisibleParent,"propertychange",this._onParentVisibilityChangeDelegate);
}else{this._invisibleParent.addEventListener("DOMAttrModified",this._onParentVisibilityChangeDelegate,false);
}}}else{if(this._invisibleParent&&this._onParentVisibilityChangeDelegate){if($telerik.isIE){$removeHandler(this._invisibleParent,"propertychange",this._onParentVisibilityChangeDelegate);
}else{this._invisibleParent.removeEventListener("DOMAttrModified",this._onParentVisibilityChangeDelegate,false);
}this._onParentVisibilityChangeDelegate=null;
this._invisibleParent=null;
}}},_onParentVisibilityChange:function(b){if($telerik.isIE){var b=b.rawEvent;
if(!b){return;
}if(b.propertyName=="style.display"||b.propertyName=="className"){var c=$telerik.getCurrentStyle(this._invisibleParent,"display");
if(c!="none"){this.repaint();
}}}else{if(b.attrName=="style"||b.attrName=="class"){var a=b.target;
if((b.currentTarget==b.originalTarget)&&"none"!=$telerik.getCurrentStyle(a,"display")){window.setTimeout(Function.createDelegate(this,function(){this.repaint();
}),0);
}}}this._fixVisibilityProblems(false);
},repaint:function(){this._createUI();
},add_itemClicking:function(a){this.get_events().addHandler("itemClicking",a);
},remove_itemClicking:function(a){this.get_events().removeHandler("itemClicking",a);
},add_itemClicked:function(a){this.get_events().addHandler("itemClicked",a);
},remove_itemClicked:function(a){this.get_events().removeHandler("itemClicked",a);
},add_mouseOver:function(a){this.get_events().addHandler("mouseOver",a);
},remove_mouseOver:function(a){this.get_events().removeHandler("mouseOver",a);
},add_mouseOut:function(a){this.get_events().addHandler("mouseOut",a);
},remove_mouseOut:function(a){this.get_events().removeHandler("mouseOut",a);
},add_itemShowing:function(a){this.get_events().addHandler("itemShowing",a);
},remove_itemShowing:function(a){this.get_events().removeHandler("itemShowing",a);
},add_itemShown:function(a){this.get_events().addHandler("itemShown",a);
},remove_itemShown:function(a){this.get_events().removeHandler("itemShown",a);
},add_load:function(a){this.get_events().addHandler("load",a);
},remove_load:function(a){this.get_events().removeHandler("load",a);
},add_buttonOver:function(a){this.get_events().addHandler("buttonOver",a);
},remove_buttonOver:function(a){this.get_events().removeHandler("buttonOver",a);
},add_buttonOut:function(a){this.get_events().addHandler("buttonOut",a);
},remove_buttonOut:function(a){this.get_events().removeHandler("buttonOut",a);
},add_buttonClick:function(a){this.get_events().addHandler("buttonClick",a);
},remove_buttonClick:function(a){this.get_events().removeHandler("buttonClick",a);
},get_items:function(){return this._items;
},set_items:function(a){this._items=a;
},get_webServiceSettings:function(){return this._webServiceSettings;
},set_webServiceSettings:function(a){var b=Sys.Serialization.JavaScriptSerializer.deserialize(a);
this._webServiceSettings=new Telerik.Web.UI.WebServiceSettings(b);
},get_pauseOnMouseOver:function(){return this._pauseOnMouseOver;
},set_pauseOnMouseOver:function(a){this._pauseOnMouseOver=a;
},get_skin:function(){return this._skin;
},set_skin:function(a){this._skin=a;
},get_enabled:function(){return this._enabled;
},set_enabled:function(a){if(a!=this._enabled){this._enabled=a;
if(this.get_isInitialized()){if(a){this.start();
}else{this.stop();
}}}}};
Telerik.Web.UI.RadRotator.registerClass("Telerik.Web.UI.RadRotator",Telerik.Web.UI.RadWebControl);
Telerik.Web.UI.RadRotatorEventArgs=function(a){Telerik.Web.UI.RadRotatorEventArgs.initializeBase(this);
this._item=a;
};
Telerik.Web.UI.RadRotatorEventArgs.prototype={get_item:function(){return this._item;
}};
Telerik.Web.UI.RadRotatorEventArgs.registerClass("Telerik.Web.UI.RadRotatorEventArgs",Sys.EventArgs);
Telerik.Web.UI.RadRotatorCancelEventArgs=function(a){Telerik.Web.UI.RadRotatorCancelEventArgs.initializeBase(this);
this._item=a;
};
Telerik.Web.UI.RadRotatorCancelEventArgs.prototype={get_item:function(){return this._item;
}};
Telerik.Web.UI.RadRotatorCancelEventArgs.registerClass("Telerik.Web.UI.RadRotatorCancelEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.RadRotatorButtonEventArgs=function(a){Telerik.Web.UI.RadRotatorButtonEventArgs.initializeBase(this);
this._button=a;
};
Telerik.Web.UI.RadRotatorButtonEventArgs.prototype={get_button:function(){return this._button;
}};
Telerik.Web.UI.RadRotatorButtonEventArgs.registerClass("Telerik.Web.UI.RadRotatorButtonEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.RadRotatorItem=function(a){Telerik.Web.UI.RadRotatorItem.initializeBase(this,[a]);
this._visible=null;
this._cssClass=null;
this._index=-1;
};
Telerik.Web.UI.RadRotatorItem.prototype={initialize:function(){Telerik.Web.UI.RadRotatorItem.callBaseMethod(this,"initialize");
this._tickers=null;
},dispose:function(){Telerik.Web.UI.RadRotatorItem.callBaseMethod(this,"dispose");
},get_index:function(){if(this._index==-1){var d=0;
var c=this.get_element();
var b=c.parentNode;
if(null!=b){var a=$telerik.getChildrenByTagName(b,"li");
if(null!=a){for(d=0;
d<a.length&&a[d]!=c;
d++){}if(d==a.length){d=0;
}}}this._index=d;
}return this._index;
},get_visible:function(){return this._visible;
},set_visible:function(a){this._visible=a;
},get_cssClass:function(){return this._cssClass;
},set_cssClass:function(a){this._cssClass=a;
},get_tickers:function(){if(null==this._tickers&&typeof(Telerik.Web.UI.RadTicker)!="undefined"){this._tickers=[];
for(var b=0,c=$telerik.radControls.length;
b<c;
b++){var a=$telerik.radControls[b];
if(Telerik.Web.UI.RadTicker.isInstanceOfType(a)&&$telerik.isDescendant(this.get_element(),a.get_element())){Array.add(this._tickers,a.get_id());
}}}return this._tickers;
}};
Telerik.Web.UI.RadRotatorItem.registerClass("Telerik.Web.UI.RadRotatorItem",Sys.UI.Control);
Telerik.Web.UI.RotatorScrollDirection=function(){throw Error.invalidOperation();
};
Telerik.Web.UI.RotatorScrollDirection.prototype={Left:1,Right:2,Up:4,Down:8};
Telerik.Web.UI.RotatorScrollDirection.registerEnum("Telerik.Web.UI.RotatorScrollDirection",false);
Telerik.Web.UI.RotatorAnimationType=function(){throw Error.invalidOperation();
};
Telerik.Web.UI.RotatorAnimationType.prototype={None:1,Fade:2,Pulse:3};
Telerik.Web.UI.RotatorAnimationType.registerEnum("Telerik.Web.UI.RotatorAnimationType",false);
Telerik.Web.UI.RotatorType=function(){throw Error.invalidOperation();
};
Telerik.Web.UI.RotatorType.prototype={AutomaticAdvance:1,ButtonsOver:2,Buttons:3,SlideShow:4,SlideShowButtons:5,FromCode:6};
Telerik.Web.UI.RotatorType.registerEnum("Telerik.Web.UI.RotatorType",false);
